1. Locale IntroductionLocale says the region. Each of the locale objects represents a specific geographical, political and cultural area.This is often used when manipulating dates, calendar, and other objects that represent date/time, because
This chapter aimsMaster the basic Realization principle of internationalization procedure. Master the role of resource files. Master the basic implementation principle of the locale class. Mastering the role of the ResourceBundle class. you can use
This chapter describes locale.
1 Locale Introduction
Locale says the region. Each of the locale objects represents a specific geographical, political and cultural area.
This is often used when manipulating dates, calendar, and other objects that
There are several constructors for the locale class:Locale (String language)Locale (String language, String country)Locale (String language, String country, string variant)The following is an instantiation of a locale object by constructing a method:
Using SpringMVC3 to configure internationalization, recently encountered "cannot change HTTP accept Header-use A different locale resolution strategy" Such an exception prompt, finally resolved. Now say about the SPRINGMVC configuration
Java uses the getDefault () method and setDefault () method of the Locale object to obtain the local country code settings. The GetSetLocale class is defined in the code. Let's talk about the reason for internationalization. International programs
JDK internationalization Overview
Introduction
Note: This html file was created with FrameMaker. If you need to change the contents, including URLs in the links, change the intl.doc FrameMaker file and then convert it to html. The
Solution:
Create a file struts. properties in the src directory.
Content is
Struts. locale = en_GB
Struts. properties File Settings configuration details:
The details are as follows:
Struts. Configuration
This attribute specifies the
After the locale information is changed, the intent. action_locale_changed message is sent,
In the activitymanagerservice. Java code updateconfigurationlocked function,
Write and receive the Code as follows:
Receive code:
Public class testreceiver
The Java language provides the resourcebundle class to process resource files of the properties type.
This article provides an explanation of the resourcebundle class.
Before starting, Let's explain what resources files of the properties type are.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.